package com.vchello.api.service.impl.user;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vchello.api.service.user.UserApiService;
import com.vchello.bean.user.User;
import com.vchello.service.user.UserService;

@Service(value = "userApiService")
@Path("api/user")
public class UserApiServiceImpl implements UserApiService {

	@Autowired
	private UserService userService;
	
	@GET
	@Path("{id : \\d+}")
	@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
	public User findByOne(@PathParam("id") int id){
		return userService.findByOne(id);
	}
	
}
